package com.example.task.thread;

import com.example.service.AsyncTaskService;

public class MyThread implements Runnable{


    private AsyncTaskService asyncTaskService;

    public MyThread(AsyncTaskService asyncTaskService) {
        this.asyncTaskService = asyncTaskService;
    }

    @Override
    public void run() {
        try {
            asyncTaskService.showMessage();
            Thread.sleep(2000L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
